<template>
	<view style="width: 100%;height: 100%;">
		<image :src="url" mode="scaleToFill" style="width: 100%;height: 100%;" @load="loadImage"></image>
	</view>
</template>
<script setup>
	import { ref,getCurrentInstance } from 'vue';

	const {proxy} =getCurrentInstance();
	const url=ref(null);//接受摸鱼人日历图片地址
	
	function getData() {
		uni.showLoading({title:'加载中...'});
		uni.request({
			url: 'https://api.vvhan.com/api/moyu?type=json',
			method: 'GET',
			success: res => {
				url.value=res.data.url;
				console.log(url.value);
			}
		});
	}
	
	function loadImage(){
		uni.showToast({icon:null,title:'获取日历成功'});
	}
	
	getData();
</script>
<style>
</style>
